<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="public/style/public.css" />
<link rel="stylesheet" type="text/css" href="public/style/list.css" />
<script type='text/javascript' src='public/jquery-1.10.1.min.js'></script>
<script type='text/javascript' src='public/layer/layer.js'></script>
<style>
	a .fixed{

		background: blue;

	}
</style>
<script>

	$(function () {
		//退出登录
		$('#logout').click(function(){


			layer.confirm('确认退出吗?',{btn:['确认','取消']},function(){

				$.ajax({
					type:'post',
					url:'logout.php?act=logout',
					dataType:'json',
					success:function(res){

						//关闭所有层
						//layer.closeAll();

						if(res.status==1){

							layer.msg(res.msg, {icon: 6});
							setTimeout("window.location.href='index.php'",3000);
							//setTimeout("location.reload()",1500);
						}else{

							layer.msg(res.msg, {icon: 5});
							//layer.closeAll();
						}

					}


				});

			},function(){



			});


		});

	});

</script>
<script>
	function f(_this){
		console.log(_this);
		window.location.href = _this.getAttribute("tiao");

	}
</script>
</head>
<body>
	<div class="header_wrap">
		<div id="header" class="auto">
			<div class="logo">小杰论坛</div>
			<div class="nav">
				<a class="hover" href="index.php">首页</a>
			</div>
			<div class="serarch">
				<form action="forum.php" method="get">
					<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>" />
					<input class="keyword" type="text" name="keywords" placeholder="搜索帖子" />
					<input class="submit" type="submit" name="submit" value="" />
				</form>
			</div>
			<?php if(empty($_SESSION['pro_username'])){  ?>
			<div class="login">
				<a href="login.php">登录</a>&nbsp;
				<a href="register.php">注册</a>
			</div>
			<?php }else{ ?>
			<a id="logout" style="color:#a25454;position: absolute;right: 50px;top: 0px;cursor: pointer;" >退出登录</a>
			<span style="float: right;color: #105cb6;">欢迎回来: <a style="color: white;cursor: pointer;"><?php echo $_SESSION['pro_username']; ?></a></span>


			<?php    }  ?>
		</div>
	</div>
	<div style="margin-top:55px;"></div>
	<div id="position" class="auto">
		 <a href="index.php">首页</a> &gt; <a><?php echo $fuji['title']; ?></a> &gt; <a><?php echo $row['title']; ?></a>
	</div>
	<div id="main" class="auto">
		<div id="left">
			<div class="box_wrap">
				<h3><?php echo $row['title']; ?></h3>
				<div class="num">
				    今日：<span>7</span>&nbsp;&nbsp;&nbsp;
				    总帖：<span>158061</span>
				</div>
				<div class="moderator">版主：<span>匿名</span></div>
				<div class="notice"><?php echo $row['description']; ?></div>
				<div class="pages_wrap">
					<a class="btn publish" href="publish.php?id=<?php echo $row['id']; ?>"></a>

					<div style="clear:both;"></div>
				</div>
			</div>
			<div style="clear:both;"></div>

			<ul class="postsList">
				<?php if(!empty($notes)){  ?>
				<?php foreach($notes as $v){ ?>
				<li>
					<div class="smallPic">
						<a href="#">
							<img width="45" height="45" src="public/style/2374101_small.jpg">
						</a>
					</div>
					<div class="subject">
						<div class="titleWrap"><a href="">[<?php echo $row['title']?>]</a>&nbsp;&nbsp;<h2><a href="show.php?id=<?php echo $v['id']; ?>"><?php echo $v['title']  ?></a></h2></div>
						<p>
							楼主：<?php echo $v['username'] ?>&nbsp;<?php echo $v['addtime'];?>&nbsp;&nbsp;&nbsp;&nbsp;最后回复：2014-12-08
						</p>
					</div>
					<div class="count">
						<p style="cursor: pointer;" tiao="show.php?id=<?php echo $v['id']; ?>" onclick="f(this);" >
							回复<br /><span>41</span>
						</p>
						<p>
							浏览<br /><span><?php echo $v['hits'] ?></span>
						</p>
					</div>
					<div style="clear:both;"></div>
				</li>
				<?php }  ?>
				<?php }else{   ?>

				<?php  echo '此版块还没有人发帖,赶快发一个吧...'; }    ?>
			</ul>
			<div class="pages_wrap">
				<div class="pages">
					<?php if(!empty($yema)){   ?>
					<a href="forum.php?id=<?php echo $_GET['id']; ?>&page=<?php echo $prev;?>">« 上一页</a>
					<!-- 自己封装的页码数组$yema -->

					<?php foreach($yema as $v){ ?>
					<?php if($v==$page){echo "<span>".$v."</span>";}else{ ?>
					<a href="forum.php?id=<?php echo $_GET['id']; ?>&page=<?php echo $v;?>"><?php echo $v; ?></a>
					<?php } ?>
					<?php } ?>
					<!-- 自己封装的页码数组$yema -->
					<a href="forum.php?id=<?php echo $_GET['id']; ?>&page=<?php echo $next;?>">下一页 »</a>
					<?php  }else{  }  ?>
				</div>
				<div style="clear:both;"></div>
			</div>
		</div>
		<div id="right">
			<div class="classList">
				<div class="title">版块列表</div>
				<ul class="listWrap">
					<?php
					foreach($zhubankuai as $v){
					?>
					<li>
						<h2><a href="forum.php?id=<?php echo $v['id']; ?>"><?php echo $v['title']; ?></a></h2>
						<ul>
							<?php
							$sql5 = "select * from bbs_forum where pid = {$v['id']}";
							$res5 = mysql_query($sql5);
							while($rows5 = mysql_fetch_assoc($res5)){
								$son[] = $rows5;
							}
							$count = mysql_num_rows($res5);
							?>
							<?php if($count===0){ ?>

							<li><h3><a href="#">暂无子版块...</a></h3></li>

							<?php }else{  ?>

							<?php foreach($son as $v2){ ?>

							<li><h3><a href="forum.php?id=<?php echo $v2['id']; ?>"><?php echo $v2['title'] ?></a></h3></li>

							<?php }   ?>

							<?php } ?>
						</ul>
					</li>
					<?php
					}
					?>
				</ul>
			</div>
		</div>
		<div style="clear:both;"></div>
	</div>
	<div id="footer" class="auto">
		<div class="bottom">
			<a>小杰</a>
		</div>
		<div class="copyright">Powered by zxj ©2015 zhaoxiaojie.club</div>
	</div>
</body>
</html>